local function find_tank_config(tank_id) --转移到configd.lua中
    local configs = IMPORT_D:query("tankattribute")
    if not configs then
        return
    end

    local config = configs[tank_id]
    if not config then
        return
    end

    return config
end

-------------------------------------------------------------------------------
---! 对外接口
-------------------------------------------------------------------------------
TANK_D = {}

function TANK_D:build_combat_data(tank)
    local result = {}
    result.user_id = tank:get_owner_id()
    result.tank_id = tank:get_id()
    result.tank_hp = tank:get_hp()
    result.born_seq = tank:get_position()
    result.camp = tank:get_camp()
    return result
end

function TANK_D:get_max_hp(tank)
    local config = CONFIG_D:get_tank(tank:get_id())
    if not config then
        return 1
    end

    ---! 气血默认值为1
    return config.hp or 1
end

function TANK_D:get_attack(tank)
    local config = CONFIG_D:get_tank(tank:get_id())
    if not config then
        return 1
    end

    ---! 攻击力默认值为1
    return config.attack or 1
end
